package com.brillilab.service.core.account.impl;

import com.brillilab.dao.mapper.account.ExchangeRecordMapper;
import com.brillilab.domain.po.account.ExchangeRecord;
import com.brillilab.service.core.account.IExchangeRecordService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;

import javax.annotation.Resource;

/**
 * <p>
 * 兑换记录表 服务实现类
 * </p>
 *
 * @author linzhikang
 * @since 2019-10-15
 */
@Service
@Transactional
public class ExchangeRecordServiceImpl implements IExchangeRecordService {
    @Resource
    private ExchangeRecordMapper exchangeRecordMapper;

    @Override
    public ExchangeRecord insert(ExchangeRecord exchangeRecord) {
        int insert = exchangeRecordMapper.insert(exchangeRecord);
        Assert.isTrue(insert == 1,"兑换记录添加失败！");
        return exchangeRecord;
    }
}
